package cn.btks.resultintegration.achievements.service.impl;

import cn.btks.resultintegration.achievements.pojo.VectorFileCategory;
import cn.btks.resultintegration.achievements.repository.VectorFileCategoryRepository;
import cn.btks.resultintegration.achievements.service.VectorFileCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @Author lijun
 * @Date 2021/2/20 15:40
 */
@Service
public class VectorFileCategoryServiceImpl implements VectorFileCategoryService {

    @Autowired
    VectorFileCategoryRepository vectorFileCategoryRepository;

    @Override
    public List<VectorFileCategory> findAll() {
        return vectorFileCategoryRepository.findAll();
    }

    @Override
    public VectorFileCategory findById(Long id) {
        Optional<VectorFileCategory> optional = vectorFileCategoryRepository.findById(id);
        if(optional.isPresent()){
            return optional.get();
        }
        return null;
    }
}
